package com.geeksx.trainer.controller;

import com.geeksx.trainer.service.StudyModeService;
import org.springframework.web.bind.annotation.*;
import com.geeksx.trainer.common.api.Result;
import com.geeksx.trainer.entity.StudyMode;
import java.util.List;

/**
 * 学习模式相关接口
 */
@RestController
@RequestMapping("/api/study-modes")
public class StudyModeController {

    private final StudyModeService studyModeService;

    public StudyModeController(StudyModeService studyModeService) {
        this.studyModeService = studyModeService;
    }

    /** 获取所有学习模式 */
    @GetMapping("/list")
    public Result<List<StudyMode>> list() {
        return Result.success(studyModeService.lambdaQuery()
                .orderByAsc(StudyMode::getSort)
                .list());
    }
}
